# 快速判断出列表中是否有重复的元素
# lst = list()
# for i in range(5):
#     lst.append(input(f"请输入第{i+1}个元素:"))
# print(lst)
# for i in lst:
#     if lst.count(i) != 1:
#         print("列表中有重复的元素")
#         break
#     else:
#         print("列表中没有重复的元素")

#输出一个字符串中最长子回文
s = input("请输入：")
res = s[::-1]
lst = list()
for i in range(0, len(s)):
    for j in range(len(s),0,-1):
        if j > i and s[i:j] == res [len(s)-j:len(s)-i]:
            lst.append(s[i:j])
max_lst = [lst[0]]
max_len = len(lst[0])
for i in lst:
    if len(i) < max_len:
        continue
    elif len(i) == max_len:
        max_lst.append(i)
        max_lst = list(set(max_lst))
    elif len(i) > max_len:
        max_lst = [i]
        max_len = len(i)
for i in max_lst:
    print(i, end = " ")
